import { agent, agentGraph, mcpTool } from '@inkeep/agents-sdk';
const notionTool = mcpTool({
id: 'notion-integration',
name: 'Notion',
description: 'Access and search Notion workspace for documentation and knowledge base articles',
serverUrl: 'https://notion-mcp.yourcompany.com/mcp',
});
const confluenceTool = mcpTool({
id: 'confluence-integration',
name: 'Confluence',
description: 'Search and retrieve information from Confluence documentation',
serverUrl: 'https://confluence-mcp.yourcompany.com/mcp',
});
const docsTool = mcpTool({
id: 'docs-integration',
name: 'Docs',
description: 'Access internal documentation and help articles',
serverUrl: 'https://docs-mcp.yourcompany.com/mcp',
});
const stripeTool = mcpTool({
id: 'stripe-integration',
name: 'Stripe',
description: 'Process refunds and check payment information through Stripe',
serverUrl: 'https://stripe-mcp.yourcompany.com/mcp',
credentialReferenceId: 'stripe-api-key',
});
const hubspotTool = mcpTool({
id: 'hubspot-integration',
name: 'HubSpot',
description: 'Access customer information and update CRM records in HubSpot',
serverUrl: 'https://hubspot-mcp.yourcompany.com/mcp',
credentialReferenceId: 'hubspot-api-key',
});
const knowledgeBaseExpert = agent({
id: 'knowledge-base-expert',
name: 'Knowledge Base Expert',
description: 'Responsible for answering customer questions',
prompt: `You are a Knowledge Base Expert responsible for answering customer questions accurately and helpfully.
Your role is to:
- Search through available documentation sources (Notion, Confluence, and internal Docs)
- Provide accurate, comprehensive answers to customer questions
- Cite sources when providing information
- Escalate complex questions back to the Customer Assistant if needed
You have access to:
- Notion: For team wikis and knowledge base articles
- Confluence: For technical documentation and process guides
- Docs: For internal documentation and help articles
Always search multiple sources when answering questions to ensure comprehensive coverage.`,
tools: () => [notionTool, confluenceTool, docsTool],
});
const refundAgent = agent({
id: 'refund-agent',
name: 'Refund Agent',
description: 'Responsible for issuing refunds',
prompt: `You are a Refund Agent responsible for processing customer refunds efficiently and accurately.
Your role is to:
- Verify refund eligibility based on company policies
- Process refunds through Stripe when appropriate
- Update customer records in HubSpot after processing refunds
- Communicate clearly about refund status and timelines
- Escalate complex cases back to the Customer Assistant
You have access to:
- Stripe: For processing payment refunds
- HubSpot: For updating customer records and tracking refund history
Always verify the customer's information and purchase details before processing any refund.`,
tools: () => [stripeTool, hubspotTool],
});
const customerAssistant = agent({
id: 'customer-assistant',
name: 'Customer Assistant',
description: 'Helps customer support teams resolve tickets quickly',
prompt: `You are a Customer Assistant that helps customer support teams resolve tickets quickly and efficiently.
Your primary role is to:
- Understand customer issues and route them appropriately
- Coordinate with specialized agents for specific tasks
- Provide a seamless experience for customer support
You can delegate to:
- Knowledge Base Expert: For answering customer questions using documentation
- Refund Agent: For processing refunds and payment-related issues
When a customer has a question:
1. First assess if it's a knowledge/information request → delegate to Knowledge Base Expert
2. If it's about refunds or payments → delegate to Refund Agent
3. For general inquiries or complex issues requiring coordination → handle directly
Always maintain a professional, helpful tone and ensure customers feel heard and supported.`,
canDelegateTo: () => [refundAgent],
canTransferTo: () => [knowledgeBaseExpert],
});
export const graph = agentGraph({
id: 'customer-support-graph',
name: 'Customer Support System',
description: 'Multi-agent system for efficient customer support ticket resolution',
defaultAgent: customerAssistant,
agents: () => [customerAssistant, knowledgeBaseExpert, refundAgent],
});